/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MidiGui;

import java.awt.Font;
import java.io.*;
import java.util.TreeMap;

/**
 *
 * @author TJ
 */
public class MusicFonts {
    private static TreeMap<String,Font> fonts=new TreeMap<String,Font>();
   static{
            File f=new File("./Fonts/Opus_Reg.ttf");
             String[][] fName=new String[][]{{"./Fonts/Opus_Reg.ttf","OpusRegular"},{"./Fonts/Opustext.ttf","OpusText"},
                 {"./Fonts/Opuschords.ttf","OpusChords"},{"./Fonts/Opuspchords.ttf","OpusPlainChords"},
                 {"./Fonts/Opusperc.ttf","OpusPercussion"},{"./Fonts/Opusspecial.ttf","OpusSpecial"}};
            try {
                for(String[] s:fName){
                    InputStream is = new FileInputStream(new File(s[0]));
                    fonts.put(s[1],Font.createFont(Font.TRUETYPE_FONT, is));
                }
            } catch (Exception ex) {
              ex.printStackTrace();
              System.err.println(fName + " not loaded.  Using serif font.");
              //font = new Font("serif", Font.PLAIN, 24);
            }
   }
   public static Font getFont(String name){return fonts.get(name);}
}
